home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / misc / pcq_libcode.lha / include / reqtools / reqtools.i next >
Encoding:
Text File  |  1993-02-02  |  7.6 KB  |  456 lines

  1. { Reqtools library copyright Nico Francois}
  2.  
  3. {Conversion to Pascal © 1991 Richard Waspe}
  4. {Conversion to PCQ    © 1992 Michael Glew}
  5.  
  6. {$I "Include:Intuition/IntuitionBase.i"}
  7. {$I "Include:Graphics/Text.i"}
  8. {$I "Include:Exec/Libraries.i"}
  9. {$I "Include:Reqtools/Utility.i"}
  10.  
  11. Const
  12.     REQTOOLNAME    = "reqtools.library";
  13.     REQTOOLSVERSION    = 37;
  14.  
  15. Type
  16.     ReqToolsBaseType = Record
  17.         LibNode        : Library;
  18.         Flags        : byte;
  19.         Pad        : Array [0..2] of byte;
  20.         SegList        : Address;
  21.         IntuitionBase    : LibraryPtr;
  22.         GfxBase        : LibraryPtr;
  23.         DOSBase        : LibraryPtr;
  24.         GadToolsBase    : LibraryPtr;
  25.         UtilityBase    : LibraryPtr
  26.     End;
  27.  
  28.     ReqToolsBasePtrType    = ^ReqToolsBaseType;
  29.  
  30. var
  31.     reqToolsBase    : ReqToolsBasePtrType;
  32.  
  33. Const
  34.     RT_FILEREQ    : Integer    = 0;
  35.     RT_REQINFO    : Integer    = 1;
  36.     RT_FONTREQ    : Integer    = 2;
  37.  
  38. {*** File Requester ***}
  39.  
  40. Type
  41.     FileRequester    = Record
  42.         ReqPos        : Integer;
  43.         LeftOffset    : Short;
  44.         TopOffset    : Short;
  45.         Flags        : Integer;
  46.         Hook        : HookPtr;
  47.         Dir        : String;
  48.         MatchPat    : String;
  49.         DefaultFont    : TextFontPtr;
  50.         WaitPointer    : Integer
  51.     End;
  52.     FileRequesterPtr = ^FileRequester;
  53.  
  54.     FileList    = Record
  55.         Next    : ^FileList;
  56.         StrLen    : Integer;
  57.         Name    : String
  58.     End;
  59.     FileListPtr = ^FileList;
  60.  
  61. {*** Font Requester ***}
  62.  
  63.     FontRequester    = Record
  64.         ReqPos        : Integer;
  65.         LeftOffset    : Short;
  66.         TopOffset    : Short;
  67.         Flags        : Integer;
  68.         Hook        : HookPtr;
  69.         Attr        : TextAttrPtr;
  70.         DefaultFont    : TextFontPtr;
  71.         WaitPointer    : Integer
  72.     End;
  73.  
  74. {*** Requester Info ***}
  75.  
  76.     ReqInfo    = Record
  77.         ReqPos        : Integer;
  78.         LeftOffset    : Short;
  79.         TopOffset    : Short;
  80.         Width        : Integer;
  81.         ReqTitle    : String;
  82.         Flags        : Integer;
  83.         DefaultFont    : TextFontPtr;
  84.         WaitPointer    : Integer
  85.     End;
  86.  
  87. {*** Handler Info ***)
  88.  
  89.     HandlerInfo    = Record
  90.         private1    : Integer;
  91.         WaitMask    : Integer;
  92.         DoNotWait    : Integer
  93.     End;
  94.  
  95. Const
  96.     CALL_HANDLER        = $80000000;
  97.  
  98. {*** TAGS ***}
  99.  
  100. const
  101.     RT_TagBase        = $80000000;
  102.  
  103.     RT_Window        = $80000001;
  104.     RT_IDCMPFlags        = $80000002;
  105.     RT_ReqPos        = $80000003;
  106.     RT_LeftOffset        = $80000004;
  107.     RT_TopOffset        = $80000005;
  108.     RT_PubScrName        = $80000006;
  109.     RT_Screen        = $80000007;
  110.     RT_ReqHandler        = $80000008;
  111.     RT_DefaultFont        = $80000009;
  112.     RT_WaitPointer        = $8000000A;
  113.  
  114.     RTEZ_ReqTitle        = $80000014;
  115.     RTEZ_Flags        = $80000016;
  116.     RTEZ_DefaultResponse    = $80000017;
  117.  
  118.     RTGL_Min        = $8000001E;
  119.     RTGL_Max        = $8000001F;
  120.     RTGL_Width        = $80000020;
  121.     RTGL_ShowDefault    = $80000021;
  122.  
  123.     RTGS_Width        = RTGL_Width;
  124.     RTGS_AllowEmpty        = $80000050;
  125.  
  126.     RTFI_Flags        = $80000028;
  127.     RTFI_Height        = $80000029;
  128.     RTFI_OkText        = $8000002A;
  129.  
  130.     RTFO_Flags        = RTFI_Flags;
  131.     RTFO_Height        = RTFI_Height;
  132.     RTFO_OkText        = RTFI_OkText;
  133.     RTFO_SampleHeight    = $8000003C;
  134.     RTFO_MinHeight        = $8000003D;
  135.     RTFO_MaxHeight        = $8000003E;
  136.  
  137.     RTFI_Dir        = $80000032;
  138.     RTFI_MatchPat        = $80000033;
  139.     RTFI_AddEntry        = $80000034;
  140.     RTFI_RemoveEntry    = $80000035;
  141.  
  142.     RTFO_FontName        = $8000003F;
  143.     RTFO_FontHeight        = $80000040;
  144.     RTFO_FontStyle        = $80000041;
  145.     RTFO_FontFlags        = $80000042;
  146.  
  147.     RTPA_Color        = $80000046;
  148.     RTRH_EndRequest        = $8000003C;
  149.  
  150.     REQPOS_POINTER        = 0;
  151.     REQPOS_CENTERWIN    = 1;
  152.     REQPOS_CENTERSCR    = 2;
  153.     REQPOS_TOPLEFTWIN    = 3;
  154.     REQPOS_TOPLEFTSCR    = 4;
  155.  
  156.     FREQB_NOBUFFER        = 2;
  157.     FREQF_NOBUFFER        = 4;
  158.     FREQB_DOWILDFUNC    = 11;
  159.     FREQF_DOWILDFUNC    = 2048;
  160.     FREQB_MULTISELECT    = 0;
  161.     FREQF_MULTISELECT    = 1;
  162.     FREQB_SAVE        = 1;
  163.     FREQF_SAVE        = 2;
  164.     FREQB_NOFILES        = 3;
  165.     FREQF_NOFILES        = 8;
  166.     FREQB_PATGAD        = 4;
  167.     FREQF_PATGAD        = 16;
  168.     FREQB_SELECTDIRS    = 12;
  169.     FREQF_SELECTDIRS    = 4096;
  170.     FREQB_FIXEDWIDTH    = 5;
  171.     FREQF_FIXEDWIDTH    = 32;
  172.     FREQB_COLORFONTS    = 6;
  173.     FREQF_COLORFONTS    = 64;
  174.     FREQB_CHANGEPALETTE    = 7;
  175.     FREQF_CHANGEPALETTE    = 128;
  176.     FREQB_LEAVEPALETTE    = 8;
  177.     FREQF_LEAVEPALETTE    = 256;
  178.     FREQB_SCALE        = 9;
  179.     FREQF_SCALE        = 512;
  180.     FREQB_STYLE        = 10;
  181.     FREQF_STYLE        = 1024;
  182.  
  183.     EZREQB_NORETURNKEY    = 0;
  184.     EZREQF_NORETURNKEY    = 1;
  185.     EZREQB_LAMIGAQUAL    = 1;
  186.     EZREQF_LAMIGAQUAL    = 2;
  187.     EZREQB_CENTERTEXT    = 2;
  188.     EZREQF_CENTERTEXT    = 4;
  189.  
  190.     REQHOOK_WILDFILE    = 0;
  191.     REQHOOK_WILDFONT    = 1;
  192.  
  193. Function AllocRequestA(type_:Integer;taglist:Address):FileRequesterPtr;
  194.  
  195. begin
  196. {$A
  197.     move.l    a6,-(sp)
  198.     lea    $8(sp),a6
  199.     move.l    (a6)+,a0
  200.     move.l    (a6)+,d0
  201.     move.l    _reqToolsBase,a6
  202.     jsr    -$1E(a6)
  203.     move.l    (sp)+,a6
  204. }
  205. end;
  206.  
  207. Procedure FreeRequest(req:Address);
  208.  
  209. begin
  210. {$A
  211.     move.l    a6,-(sp)
  212.     move.l    $8(sp),a1
  213.     move.l    _reqToolsBase,a6
  214.     jsr    -$24(a6)
  215.     move.l    (sp)+,a6
  216. }
  217. end;
  218.  
  219. Procedure FreeReqBuffer(req:Address);
  220.  
  221. begin
  222. {$A
  223.     move.l    a6,-(sp)
  224.     move.l    $8(sp),a1
  225.     move.l    _reqToolsBase,a6
  226.     jsr    -$2A(a6)
  227.     move.l    (sp)+,a6
  228. }
  229. end;
  230.  
  231. Procedure ChangeReqAttrA(req,taglist:Address);
  232.  
  233. begin
  234. {$A
  235.     move.l    a6,-(sp)
  236.     movem.l    $8(sp),a0-a1
  237.     move.l    _reqToolsBase,a6
  238.     jsr    -$30(a6)
  239.     move.l    (sp)+,a6
  240. }
  241. end;
  242.  
  243. Function FileRequestA(filereq,file_,title,taglist:Address):Integer;
  244.  
  245. begin
  246. {$A
  247.     movem.l    a2-a3/a6,-(sp)
  248.     lea    $10(sp),a6
  249.     move.l    (a6)+,a0
  250.     move.l    (a6)+,a3
  251.     move.l    (a6)+,a2
  252.     move.l    (a6)+,a1
  253.     move.l    _reqToolsBase,a6
  254.     jsr    -$36(a6)
  255.     movem.l    (sp)+,a2-a3/a6
  256. }
  257. end;
  258.  
  259. Procedure FreeFileList(filelist:Address);
  260.  
  261. begin
  262. {$A
  263.     move.l    a6,-(sp)
  264.     move.l    $8(sp),a0
  265.     move.l    _reqToolsBase,a6
  266.     jsr    -$3C(a6)
  267.     move.l    (sp)+,a6
  268. }
  269. end;
  270.  
  271. Function EZRequestA(bodyfmt,gadfmt,reqinfo,argarray,taglist:Address):Integer;
  272.  
  273. begin
  274. {$A
  275.     movem.l    a2-a4/a6,-(sp)
  276.     lea    $14(sp),a6
  277.     move.l    (a6)+,a0
  278.     move.l    (a6)+,a4
  279.     move.l    (a6)+,a3
  280.     move.l    (a6)+,a2
  281.     move.l    (a6)+,a1
  282.     move.l    _reqToolsBase,a6
  283.     jsr    -$42(a6)
  284.     movem.l    (sp)+,a2-a4/a6
  285. }
  286. end;
  287.  
  288. Function GetStringA(buffer:Address;maxchars:Integer;
  289.             title,reqinfo,taglist:Address):Integer;
  290.  
  291. begin
  292. {$A
  293.     movem.l    a2-a3/a6,-(sp)
  294.     lea    $10(sp),a6
  295.     move.l    (a6)+,a0
  296.     move.l    (a6)+,a3
  297.     move.l    (a6)+,a2
  298.     move.l    (a6)+,d0
  299.     move.l    (a6)+,a1
  300.     move.l    _reqToolsBase,a6
  301.     jsr    -$48(a6)
  302.     movem.l    (sp)+,a2-a3/a6
  303. }
  304. end;
  305.  
  306. Function GetLongA(longptr,title,reqinfo,taglist:Address):Integer;
  307.  
  308. begin
  309. {$A
  310.     movem.l    a2-a3/a6,-(sp)
  311.     lea    $10(sp),a6
  312.     move.l    (a6)+,a0
  313.     move.l    (a6)+,a3
  314.     move.l    (a6)+,a2
  315.     move.l    (a6)+,a1
  316.     move.l    _reqToolsBase,a6
  317.     jsr    -$4E(a6)
  318.     movem.l    (sp)+,a2-a3/a6
  319. }
  320. end;
  321.  
  322. Function FontRequestA(fontreq,title,taglist:Address):Integer;
  323.  
  324. begin
  325. {$A
  326.     movem.l    a3/a6,-(sp)
  327.     lea    $C(sp),a6
  328.     move.l    (a6)+,a0
  329.     move.l    (a6)+,a3
  330.     move.l    (a6)+,a1
  331.     move.l    _reqToolsBase,a6
  332.     jsr    -$60(a6)
  333.     movem.l    (sp)+,a3/a6
  334. }
  335. end;
  336.  
  337. Function PaletteRequestA(title,reqinfo,taglist:Address):Integer;
  338.  
  339. begin
  340. {$A
  341.     movem.l    a2-a3/a6,-(sp)
  342.     lea    $10(sp),a6
  343.     move.l    (a6)+,a0
  344.     move.l    (a6)+,a3
  345.     move.l    (a6)+,a2
  346.     move.l    _reqToolsBase,a6
  347.     jsr    -$66(a6)
  348.     movem.l    (sp)+,a2-a3/a6
  349. }
  350. end;
  351.  
  352. Function ReqHandlerA(handlerinfo:Address;sigs:Integer;
  353.             taglist:Address):Integer;
  354.  
  355. begin
  356. {$A
  357.     move.l    a6,-(sp)
  358.     lea    $8(sp),a6
  359.     move.l    (a6)+,a0
  360.     move.l    (a6)+,d0
  361.     move.l    (a6)+,a1
  362.     move.l    _reqToolsBase,a6
  363.     jsr    -$6C(a6)
  364.     move.l    (sp)+,a6
  365. }
  366. end;
  367.  
  368. Function SetWaitPointer(window:Address):Integer;
  369.  
  370. begin
  371. {$A
  372.     move.l    a6,-(sp)
  373.     move.l    $8(sp),a0
  374.     move.l    _reqToolsBase,a6
  375.     jsr    -$72(a6)
  376.     move.l    (sp)+,a6
  377. }
  378. end;
  379.  
  380. Function GetVScreenSize(screen,widthptr,heightptr:Address):Integer;
  381.  
  382. begin
  383. {$A
  384.     movem.l    a2/a6,-(sp)
  385.     lea    $C(sp),a6
  386.     move.l    (a6)+,a2
  387.     move.l    (a6)+,a1
  388.     move.l    (a6)+,a0
  389.     move.l    _reqToolsBase,a6
  390.     jsr    -$78(a6)
  391.     movem.l    (sp)+,a2/a6
  392. }
  393. end;
  394.  
  395. Function SetReqPosition(reqpos:Integer;
  396.             newwindow,screen,window:Address): Integer;
  397.  
  398. begin
  399. {$A
  400.     movem.l    a2/a6,-(sp)
  401.     lea    $C(sp),a6
  402.     move.l    (a6)+,a2
  403.     move.l    (a6)+,a1
  404.     move.l    (a6)+,a0
  405.     move.l    (a6)+,d0
  406.     move.l    _reqToolsBase,a6
  407.     jsr    -$7E(a6)
  408.     movem.l    (sp)+,a2/a6
  409. }
  410. end;
  411.  
  412. Function Spread(posarray,sizearray:Address;
  413.             length,min,max,num:Integer):Integer;
  414.  
  415. begin
  416. {$A
  417.     movem.l    d3/a6,-(sp)
  418.     lea    $C(sp),a6
  419.     move.l    (a6)+,d3
  420.     move.l    (a6)+,d2
  421.     move.l    (a6)+,d1
  422.     move.l    (a6)+,d0
  423.     move.l    (a6)+,a1
  424.     move.l    (a6)+,a0
  425.     move.l    _reqToolsBase,a6
  426.     jsr    -$84(a6)
  427.     movem.l    (sp)+,d3/a6
  428. }
  429. end;
  430.  
  431. Function ScreenToFrontSafely(screen:Address):Integer;
  432.  
  433. begin
  434. {$A
  435.     move.l    a6,-(sp)
  436.     move.l    $8(sp),a0
  437.     move.l    _reqToolsBase,a6
  438.     jsr    -$8A(a6)
  439.     move.l    (sp)+,a6
  440. }
  441. end;
  442.  
  443. Procedure EZrequest(a,b:string;X,y:Address);
  444.  
  445. begin
  446. {$A
  447.     movem.l    a2/a3/a4/a6,-(a7)
  448.     move.l    _reqToolsBase,a6
  449.     movem.l    20(a7),a1/a2/a3
  450.     move.l    32(a7),a0
  451.     lea        36(a7),a4
  452.     jsr        -$42(a6)
  453.     movem.l    (a7)+,a2/a3/a4/a6
  454. }
  455. end;
  456.